public class Main {
    public static void main(String[] args) {
        int flag = 1;
        for (int i = 100; i < 1000; i++) {
            int tmp = i;
            int count = 0;
            while (tmp != 0) {
                count++;
                tmp /= 10;
            }
            tmp = i;
            int sum = 0;
            while (tmp != 0) {
                sum += Math.pow(tmp % 10, count);
                tmp /= 10;
            }
            if (sum == i && flag == 1) {
                System.out.print(i);
                flag = 0;
            } else if (sum == i && flag == 0)
                System.out.print("," + i);
        }
    }
}
